/**
 * Created by toor on 17-10-10.
 */
import Vue from 'vx';

Vue.filter('amountTwoFtr', function (input) {
	if (input !== undefined && input > 9999) {
		return input / 10000 + '万';
	} else {
		return input;
	}
});

Vue.filter('showDay', function (input) {
	if (!input) {
		return;
	} else if (input * 1 + "" == 'NaN') {
		return input;
	} else {
		return input + "天";
	}
});

Vue.filter('riskLevelCalor', function (input) {
	switch (input) {
		case '0':
		case 0:
			return "risk_no";
			break;
		case '1':
		case 1:
			return "risk_di";
			break;
		case '2':
		case 2:
			return "risk_di";
			break;
		case '3':
		case 3:
			return "risk_di";
			break;
		case '4':
		case 4:
			return "risk_zhong";
			break;
		case '5':
		case 5:
			return "risk_gao";
			break;
		default:
			return "risk_gao";
			break;
	}
});


Vue.filter('MonthToUpper', function (input) {
	if (input !== undefined) {
		var date = new Date();
		var month = date.getMonth() + 1;
		//当前月份

		if (input == month) {
			return "本";
		} else {
			switch (input) {
				case "1":
					return "一";
				case "2":
					return "二";
				case "3":
					return "三";
				case "4":
					return "四";
				case "5":
					return "五";
				case "6":
					return "六";
				case "7":
					return "七";
				case "8":
					return "八";
				case "9":
					return "九";
				case "10":
					return "十";
				case "11":
					return "十一";
				case "12":
					return "十二";
				default:
					return input;
			}
		}
	}
	return input;
});